﻿using Silk.NET.OpenGLES;
using System;
using System.Numerics;
using System.Threading.Tasks;
using TTEngine.Graphics;
using IGLES = Silk.NET.OpenGLES.GL;
namespace TTEngine
{
    //要么是个窗口应用，要么只是一个View
    public interface IView:ITarget
    {
        public Vector2 Center
        {
            get;
        }
        IGLES GL
        {
            get;
        }
        IInput input { get; }
        IGameWindow TryGetWindow();
        float Scale
        {
            get;
        }
        void InvokeGfxThread(Action<IGLES> action);
        Task InvokeGfxThreadAsync(Action<IGLES> action);
        Action OnRender
        {
            get;
            set;
        }
        Action<float/*delta*/> OnUpdate
        {
            get;
            set;
        }
        Action<int/*width*/, int/*height*/> OnResize
        {
            get;
            set;
        }
    }

    //把平台接口隔离开
    public interface IGameWindow
    {

    
        #region 基础窗口操作

        string Title
        {
            get; set;
        }
        bool IsDesktopPlatform();//是否是桌面平台
       
        void Hide();
        void Show();
        void Close();
        #endregion
        #region 窗口尺寸

        bool CanResize { get; }
        bool CanToogleFullScreen { get; }
        bool CanHide
        {
            get;
        }


        bool FullScreen
        {
            get;
            set;
        }
        //尺寸控制
        int ScreenWidth
        {
            get;
        }
        int ScreenHeight
        {
            get;
        }
        float ScreenScaleRadio
        {
            get;
        }

        void ResizeAndCenter(int w, int h);
        void SetPos(int x, int y, int w, int h);


        #endregion







        #region FrameDebug功能 (RenderDoc集成)
        bool IsFrameDebugInit
        {
            get;
        }
        void FrameDebug_Overlay(bool show);

        void FrameDebug_OpenApp();
        void FrameDebug_StartFrameCapture();
        void FrameDebug_EndFrameCapture();
        #endregion



    }



}